< previous page page_716 next page >

Page 716
Menu Naming Conventions
Just like custom controls, all the various menus you create should also use appropriate prefixes (see Table A.3). The prefix mnu should be used on all menus. This prefix should be followed by the caption of the menu. For each pull-down menu under the main menu item, use the first letter of top-level menu.
Table A.3 Naming Menus.
Menu Caption SequenceMenu Handler Name
FilemnuFile
File.NewmnuFNew
File.OpenmnuFOpen
File.SendmnuFSend
File.Send.FaxmnuFSFax
File.Send.EmailmnuFSEmail
HelpmnuHelp
Help.AboutmnuHAbout

When this convention is used, all members of a particular menu group are listed next to each other in the Object drop-down list boxes (in the Code and Property windows). In addition, the menu control names clearly document the menu items to which theyre attached.
Naming Conventions for Other Controls
For new controls not listed so far, try to come up with unique three-character prefixes. Note, however, that its more important to be clear than to stick to a three-character convention.
For derivative controls, such as an enhanced list box, extend the preceding prefixes so that theres no confusion over which control is really being used. A lowercase abbreviation for the manufacturer could be added to the prefix. For example, a Crescent QuickPak Professional text box control could be named ctxtFirstName.

 
< previous page page_716 next page >

If you like this book, buy it!